Skip to content

Conversation

@MaxBlack-dev
Copy link
Contributor

Fixes #8684

What / Why

When running npm token create, the created authentication token was being redacted in the output, making it difficult for users to copy and use the token. This happened because npm's output system automatically applies redaction to sensitive information like tokens.

How

  • Import META from proc-log to access output metadata options
  • Use { [META]: true, redact: false } option in output.standard() to disable redaction for the token display line
  • This follows the established pattern used in other parts of the codebase (e.g., lib/utils/open-url.js) for displaying sensitive information that users need to see

Testing

  • All existing tests pass
  • The fix preserves the existing output format and test expectations
  • Token is now displayed in full while maintaining proper formatting and colors

Before

Created publish token npm_***

After

Created publish token npm_1a2b3c4d5e6f7g8h9i0j

The token can now be copied and used directly without being obscured by npm's redaction system.

@MaxBlack-dev MaxBlack-dev requested a review from a team as a code owner October 30, 2025 05:32
Copy link
Contributor

@mbtools mbtools left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. thx!

@wraithgar wraithgar merged commit 11dbd7e into npm:latest Nov 3, 2025
20 checks passed
@wraithgar
Copy link
Member

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] npm token create no longer prints token

3 participants